package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.InfixtoPostfixTranslator;

// InfixtoPostfixTranslator test
public class WinstonCheongIPTest{

	@Before
	public void setUp() throws Exception{}

	@After
	public void tearDown() throws Exception{}

	@Test
	public void test(){
		assertTrue(InfixtoPostfixTranslator.eval("1    +    2").equals("1 2 +"));
		assertTrue(InfixtoPostfixTranslator.eval("5 / 3 + 2 * 9").equals("5 3 / 2 9 * +"));
		assertTrue(InfixtoPostfixTranslator.eval("( 2 + 3 ) * 8").equals("2 3 + 8 *"));
		assertTrue(InfixtoPostfixTranslator.eval("2 + ( 3 * 8 )").equals("2 3 8 * +"));
		assertTrue(InfixtoPostfixTranslator.eval("2 * 3 * 7").equals("2 3 * 7 *"));
		assertTrue(InfixtoPostfixTranslator.eval("2 ^ 3 ^ 4").equals("2 3 4 ^ ^"));
		assertEquals(InfixtoPostfixTranslator.eval("2 * 2 + 3"), "2 2 * 3 +");
		assertEquals(InfixtoPostfixTranslator.eval("2 + 2 * 3"), "2 2 3 * +");
		assertEquals(InfixtoPostfixTranslator.eval("( 2 * 3 ) + ( 1 + 6 / 2 ) * 5"), "2 3 * 1 6 2 / + 5 * +");
		assertEquals(InfixtoPostfixTranslator.eval("1 * 2 * 3"), "1 2 * 3 *");
		assertEquals(InfixtoPostfixTranslator.eval("2 ^ 3 ^ 4"), "2 3 4 ^ ^");
		assertEquals(InfixtoPostfixTranslator.eval("1 + 2 * 3 ^ 4 / 5 / 6"),"1 2 3 4 ^ * 5 / 6 / +");
	}

}
